  <section role="main" class="page-wrapper">

    <article class="content-box minimizer">
      <header>
        <h2>Email Performance</h2>
      </header>
      <section>

        <!-- Tab Content #tab1 -->
        <div class="tab default-tab" id="tab1">
          <h3>Email Campaigns</h3>
          <?php foreach($emailCampaigns as $emailCampaign): ?>
            <p>
              <form method="POST" <?php /*enctype="multipart/form-data"*/ ?> name="campaign_<?php echo $emailCampaign['id'] ?>" action="<?php echo url_for($sf_context->getModuleName().'/mapFields') ?>">
                <input type="hidden" name="campaign_id" value="<?php echo $emailCampaign['id'] ?>" />
                <?php echo $emailCampaign['short_label'] ?>
                &mdash;
                Upload file:
                <select name="file_type"> 
                <?php if(!is_null($emailCampaign['files_uploaded'])): ?>
                  <?php foreach($filesToUpload as $key=>$fileToUpload): ?>
                    <?php $dependenciesOk = 0 ?>
                    <?php foreach($fileToUpload['dependencies'] as $dependency): ?>
                      <?php if(in_array($dependency, explode(',', $emailCampaign['files_uploaded']))): ?>
                        <?php $dependenciesOk++ ?>
                      <?php endif ?>
                    <?php endforeach ?>
                    <?php if((!in_array($key, explode(',', $emailCampaign['files_uploaded']))) && ($dependenciesOk == count($fileToUpload['dependencies']))): ?>
                    <option><?php echo $key ?></option>
                    <?php endif ?>
                  <?php endforeach ?>                
                <?php else: ?>
                  <option value="selected">selected</option>
                <?php endif ?>
                </select>
                &mdash;
                <!--<input type="file" name="upload_file" />-->
                <select name="file_name">
                <?php foreach($folderFiles as $folderFile): ?>
                  <option value="<?php echo $folderFile ?>"><?php echo $folderFile ?></option>
                <?php endforeach ?>
                </select>
                <input type="submit" value="Submit" />
              </form>
            </p>
          <?php endforeach ?>        
          
          
        </div>


      </section>

    </article>


  </section>
  
  
  <script>
  
  </script>